package com.hp.team.bookstore.model.catalog;

import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "CATALOG")
public class Catalog extends CatalogItem {
	
	@OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL, mappedBy="parentCatalog")
	private Set<Category> rootCategories;

	public Set<Category> getRootCategories() {
		return rootCategories;
	}

	public void setRootCategories(Set<Category> rootCategories) {
		this.rootCategories = rootCategories;
	}

}
